Optimal. Leaf size=48 \[ \frac {\tan ^{-1}\left (\frac {\sqrt {b} \sin (x)}{\sqrt {a}}\right )}{2 a^{3/2} \sqrt {b}}+\frac {\sin (x)}{2 a \left (a+b \sin ^2(x)\right )} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.02, antiderivative size = 48, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 3, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.231, Rules used = {3269, 205, 211}
\begin {gather*} \frac {\text {ArcTan}\left (\frac {\sqrt {b} \sin (x)}{\sqrt {a}}\right )}{2 a^{3/2} \sqrt {b}}+\frac {\sin (x)}{2 a \left (a+b \sin ^2(x)\right )} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 205
Rule 211
Rule 3269
Rubi steps
\begin {align*} \int \frac {\cos (x)}{\left (a+b \sin ^2(x)\right )^2} \, dx &=\text {Subst}\left (\int \frac {1}{\left (a+b x^2\right )^2} \, dx,x,\sin (x)\right )\\ &=\frac {\sin (x)}{2 a \left (a+b \sin ^2(x)\right )}+\frac {\text {Subst}\left (\int \frac {1}{a+b x^2} \, dx,x,\sin (x)\right )}{2 a}\\ &=\frac {\tan ^{-1}\left (\frac {\sqrt {b} \sin (x)}{\sqrt {a}}\right )}{2 a^{3/2} \sqrt {b}}+\frac {\sin (x)}{2 a \left (a+b \sin ^2(x)\right )}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.04, size = 48, normalized size = 1.00 \begin {gather*} \frac {\tan ^{-1}\left (\frac {\sqrt {b} \sin (x)}{\sqrt {a}}\right )}{2 a^{3/2} \sqrt {b}}+\frac {\sin (x)}{2 a \left (a+b \sin ^2(x)\right )} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.15, size = 39, normalized size = 0.81
method | result | size |
derivativedivides | \(\frac {\sin \left (x \right )}{2 a \left (a +b \left (\sin ^{2}\left (x \right )\right )\right )}+\frac {\arctan \left (\frac {b \sin \left (x \right )}{\sqrt {a b}}\right )}{2 a \sqrt {a b}}\) | \(39\) |
default | \(\frac {\sin \left (x \right )}{2 a \left (a +b \left (\sin ^{2}\left (x \right )\right )\right )}+\frac {\arctan \left (\frac {b \sin \left (x \right )}{\sqrt {a b}}\right )}{2 a \sqrt {a b}}\) | \(39\) |
risch | \(\frac {i \left ({\mathrm e}^{3 i x}-{\mathrm e}^{i x}\right )}{a \left (b \,{\mathrm e}^{4 i x}-4 a \,{\mathrm e}^{2 i x}-2 b \,{\mathrm e}^{2 i x}+b \right )}-\frac {\ln \left ({\mathrm e}^{2 i x}-\frac {2 i a \,{\mathrm e}^{i x}}{\sqrt {-a b}}-1\right )}{4 \sqrt {-a b}\, a}+\frac {\ln \left ({\mathrm e}^{2 i x}+\frac {2 i a \,{\mathrm e}^{i x}}{\sqrt {-a b}}-1\right )}{4 \sqrt {-a b}\, a}\) | \(116\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.51, size = 38, normalized size = 0.79 \begin {gather*} \frac {\sin \left (x\right )}{2 \, {\left (a b \sin \left (x\right )^{2} + a^{2}\right )}} + \frac {\arctan \left (\frac {b \sin \left (x\right )}{\sqrt {a b}}\right )}{2 \, \sqrt {a b} a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.39, size = 165, normalized size = 3.44 \begin {gather*} \left [-\frac {2 \, a b \sin \left (x\right ) + {\left (b \cos \left (x\right )^{2} - a - b\right )} \sqrt {-a b} \log \left (-\frac {b \cos \left (x\right )^{2} + 2 \, \sqrt {-a b} \sin \left (x\right ) + a - b}{b \cos \left (x\right )^{2} - a - b}\right )}{4 \, {\left (a^{2} b^{2} \cos \left (x\right )^{2} - a^{3} b - a^{2} b^{2}\right )}}, -\frac {a b \sin \left (x\right ) - {\left (b \cos \left (x\right )^{2} - a - b\right )} \sqrt {a b} \arctan \left (\frac {\sqrt {a b} \sin \left (x\right )}{a}\right )}{2 \, {\left (a^{2} b^{2} \cos \left (x\right )^{2} - a^{3} b - a^{2} b^{2}\right )}}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 289 vs.
\(2 (41) = 82\).
time = 3.44, size = 289, normalized size = 6.02 \begin {gather*} \begin {cases} \frac {\tilde {\infty }}{\sin ^{3}{\left (x \right )}} & \text {for}\: a = 0 \wedge b = 0 \\\frac {\sin {\left (x \right )}}{a^{2}} & \text {for}\: b = 0 \\- \frac {1}{3 b^{2} \sin ^{3}{\left (x \right )}} & \text {for}\: a = 0 \\\frac {a \log {\left (- \sqrt {- \frac {a}{b}} + \sin {\left (x \right )} \right )}}{4 a^{2} b \sqrt {- \frac {a}{b}} + 4 a b^{2} \sqrt {- \frac {a}{b}} \sin ^{2}{\left (x \right )}} - \frac {a \log {\left (\sqrt {- \frac {a}{b}} + \sin {\left (x \right )} \right )}}{4 a^{2} b \sqrt {- \frac {a}{b}} + 4 a b^{2} \sqrt {- \frac {a}{b}} \sin ^{2}{\left (x \right )}} + \frac {2 b \sqrt {- \frac {a}{b}} \sin {\left (x \right )}}{4 a^{2} b \sqrt {- \frac {a}{b}} + 4 a b^{2} \sqrt {- \frac {a}{b}} \sin ^{2}{\left (x \right )}} + \frac {b \log {\left (- \sqrt {- \frac {a}{b}} + \sin {\left (x \right )} \right )} \sin ^{2}{\left (x \right )}}{4 a^{2} b \sqrt {- \frac {a}{b}} + 4 a b^{2} \sqrt {- \frac {a}{b}} \sin ^{2}{\left (x \right )}} - \frac {b \log {\left (\sqrt {- \frac {a}{b}} + \sin {\left (x \right )} \right )} \sin ^{2}{\left (x \right )}}{4 a^{2} b \sqrt {- \frac {a}{b}} + 4 a b^{2} \sqrt {- \frac {a}{b}} \sin ^{2}{\left (x \right )}} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.44, size = 38, normalized size = 0.79 \begin {gather*} \frac {\arctan \left (\frac {b \sin \left (x\right )}{\sqrt {a b}}\right )}{2 \, \sqrt {a b} a} + \frac {\sin \left (x\right )}{2 \, {\left (b \sin \left (x\right )^{2} + a\right )} a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 15.38, size = 36, normalized size = 0.75 \begin {gather*} \frac {\mathrm {atan}\left (\frac {\sqrt {b}\,\sin \left (x\right )}{\sqrt {a}}\right )}{2\,a^{3/2}\,\sqrt {b}}+\frac {\sin \left (x\right )}{2\,a\,\left (b\,{\sin \left (x\right )}^2+a\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________